﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for Player
/// </summary>
/// 
namespace com.ClickCricket.bll
{
    public class Player
    {
        public int PlayerId { get; set; }
        public string PlayerFirstName { get; set; }
        public string PlayerLastName { get; set; }
        public DateTime DateOfBirth { get; set; }
        public int CountryId { get; set; }
        public string PlayerNickName { get; set; }
        public string PlayerImage { get; set; }

        private Country country;
        public Country Country 
        {
            get
            {
                if (country == null)
                {
                    country = CountryService.Instance.getCountry(CountryId);
                }
                return country;
            }
        }
        
        public Player(
            int playerId,
            string playerFirstName,
            string playerLastName,  
            DateTime dateOfBirth,
            int countryId,
            string playerNickName,
            string playerImage
            )
        {
            PlayerId = playerId;
            PlayerFirstName = playerFirstName;
            PlayerLastName = playerLastName;
            DateOfBirth = dateOfBirth;
            CountryId = countryId;
            PlayerNickName = playerNickName;
            PlayerImage = playerImage;
        }
        public Player()
        {
            //
            // TODO: Add constructor logic here
            //
        }
    }
}
